package org.esgi.user.model;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

public class ConnectionMysql {

	public final static String HOST = "127.0.0.1";
	public final static String PORT = "3306";
	public final static String SCHEMA = "fileshare";
	public final static String LOGIN = "root";
	public final static String PASSWORD = "root";
	
	public PreparedStatement selectById = null;
	

//	private static ConnectionMysql _instance = new ConnectionMysql();
	protected Connection connection = null;

	public ConnectionMysql() {
		try {
			Class.forName("com.mysql.jdbc.Driver");
			this.connection = DriverManager.getConnection("jdbc:mysql://"
					+ HOST + ":" + PORT + "/" + SCHEMA, LOGIN, PASSWORD);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

//	public static ConnectionMysql getInstance() {
//		return _instance;
//	}
//
	public Connection getConnection() {
		return connection;
	}

	public void setConnection(Connection connection) {
		this.connection = connection;
	}
	
}
